package GameLogic;



public class Background implements  Comparable{
    public double MapOffset;   //using global coordinates
    public double MapYPosBeg;  // -1.0
    public double MapYPosEnd;  //  1.0
    public double BackgroundLoops; // 0 = infinite
    public double MapZPos;     //how close to the screen the background (can be also foreground) is rendered
    public double BackgroundSpeed; //how fast the background moves. 1 - same speed as main screen
                            // (notice parallax effect due to perspective projection)
    public String TexturePath;   //single file
    public boolean AbsoluteCoordinates; //if true : doesn't matter Z coordinate. Screen coverage is always the same


    public Background(double MapOffset, double MapYPosBeg,double MapYPosEnd,boolean AbsoluteCoordinates, double MapZPos, double BackgroundSpeed, double BackgroundLoops, String TexturePath){
        this.MapOffset = MapOffset;
        this.MapYPosBeg = MapYPosBeg;
        this.MapYPosEnd = MapYPosEnd;
        this.MapZPos = MapZPos;
        this.BackgroundSpeed = BackgroundSpeed;
        this.BackgroundLoops = BackgroundLoops;
        this.TexturePath = TexturePath;
        this.AbsoluteCoordinates = AbsoluteCoordinates;
    }

    @Override
    public int compareTo(Object o) {
        if (MapZPos < ((Background)o).MapZPos) return -1;
        if (MapZPos > ((Background)o).MapZPos) return 1;
        if (MapZPos == ((Background)o).MapZPos) return 0;
        return 0;
    }
}
